from psp2d import Image
        
_loaded_images = {} 

def get( img_name ):
    if img_name in _loaded_images:
        return _loaded_images[ img_name ]
    full_path = '.'.join( [__name__, img_name] )
    dotcount = full_path.count('.') - 1
    full_path = full_path.replace('.', '/', dotcount)
    img = Image(full_path)
    if img:
        _loaded_images[ img_name ] = img
        return img
    else:
        return None